


import 'package:mop_ext_wechat/mop_ext_wechat_handlers.dart';

class MyWechatHandlers implements MopExtWechatForwardAppletHandler,
    MopExtWechatGetUserInfoHandler,
    MopExtWechatGetUserProfileHandler,
    MopExtWechatContactHandler,
    MopExtWechatGetPhoneNumberHandler,
    MopExtWechatLaunchAppHandler,
    MopExtWechatFeedbackHandler,
    MopExtWechatChooseAvatarHandler {
  @override
  Future<MopExtWechatHandlerResult> chooseAvatar(Map<String, dynamic> appletInfo) async {
    var data = {
      'detail': {
        'avatalUrl': 'https://images.unsplash.com/photo-1438761681033-6461ffad8d80?ixlib=rb-1.2.1&auto=format&fit=crop&w=200&h=200&q=80'
      }
    };
    MopExtWechatHandlerResult result = MopExtWechatHandlerResult(success: true, data: data);
    return Future.value(result);
  }

  @override
  Future<MopExtWechatHandlerResult> contact(Map<String, dynamic> appletInfo, String sessionFrom, String sendMessageTitle, String sendMessagePath, String sendMessageImg, bool showMessageCard) async {
    MopExtWechatHandlerResult result = MopExtWechatHandlerResult(success: true, data: null);
    return Future.value(result);
  }

  @override
  Future<MopExtWechatHandlerResult> feedback(Map<String, dynamic> appletInfo) async {
    MopExtWechatHandlerResult result = MopExtWechatHandlerResult(success: true, data: null);
    return Future.value(result);
  }

  @override
  Future<MopExtWechatHandlerResult> forwardApplet(Map<String, dynamic> contentInfo) async {
    MopExtWechatHandlerResult result = MopExtWechatHandlerResult(success: true, data: null);
    return Future.value(result);
  }

  @override
  Future<MopExtWechatHandlerResult> getPhoneNumber(Map<String, dynamic> appletInfo) async {

    var data = {
      'detail': {
        "code": 'xxxxxxxxxxx'
      }
    };
    MopExtWechatHandlerResult result = MopExtWechatHandlerResult(success: true, data: data);
    return Future.value(result);
  }

  @override
  Future<MopExtWechatHandlerResult> getUserInfo(Map<String, dynamic> appletInfo) async {
    var data = {
      'detail': {
        'nickName': 'finclip'
      }
    };
    MopExtWechatHandlerResult result = MopExtWechatHandlerResult(success: true, data: data);
    return Future.value(result);
  }

  @override
  Future<MopExtWechatHandlerResult> getUserProfile(Map<String, dynamic> appletInfo) async {
    var data = {
      'detail': {
        'nickName': 'finclip',
        'phone': '18600000000'
      }
    };
    MopExtWechatHandlerResult result = MopExtWechatHandlerResult(success: true, data: data);
    return Future.value(result);
  }

  @override
  Future<MopExtWechatHandlerResult> launchApp(Map<String, dynamic> appletInfo, String appParameter) async {
    var data = {
      'detail': {
        'msg': 'launchApp success'
      }
    };
    MopExtWechatHandlerResult result = MopExtWechatHandlerResult(success: true, data: data);
    return Future.value(result);
  }

  
}
